package com.neptune.imapp.repository.service

import com.neptune.imapp.repository.entity.Resume
import com.neptune.imapp.repository.vo.*
import retrofit2.http.*

interface UserService {
    @POST("/login")
    @FormUrlEncoded
    suspend fun loginAsync(
        @Field("username") username: String,
        @Field("password") password: String
    ): Response<String>

    @POST("/Candidate")
    suspend fun postBasicInfo(@Body user: UserVO): Response<String>

    @POST("/User/{telephone}/{password}")
    suspend fun register(
        @Path("telephone") telephone: String,
        @Path("password") password: String
    ): Response<String>

    @GET("/User/{telephone}")
    suspend fun checkTelephone(@Path("telephone") telephone: String): Response<String>

    @GET("/Candidate/{id}")
    suspend fun getSelfInfo(@Path("id") id: Long): Response<SelfInfo>

    @GET("/Candidate/Resume/{id}")
    suspend fun getSelfResume(@Path("id") id: Long): Response<Resume>

    @GET("/Apply/{id}")
    suspend fun getSelfApply(@Path("id") id: Long): Response<List<Apply>>

    @GET("/Apply/Main/Filter")
    suspend fun getMainApply(
        @Query("minSalary") minSalary: Float,
        @Query("maxSalary") maxSalary: Float,
        @Query("address") address: String,
        @Query("education") education: String,
        @Query("time") time: Int,
        @Query("vacation") vacation: String,
        @Query("name") name: String
    ): Response<List<ApplyForMain>>
}